package com.bilibili.chatonline.util;

import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.core.io.ClassPathResource;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ReadProperties {
    private static final Properties properties;
    static {
        YamlPropertiesFactoryBean yamlFactory = new YamlPropertiesFactoryBean();
        yamlFactory.setResources(new ClassPathResource("application.yml"));
        properties = yamlFactory.getObject();
    }
    public static String getProperty(String key) throws IOException {
        return properties.getProperty(key);
    }

}
